﻿Public Partial Class list
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

   
    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged


        Dim index As Integer = GridView1.SelectedIndex

        ' Display the primary key value of the selected row.
        Dim row As GridViewRow = GridView1.SelectedRow

        'Response.Redirect("details.aspx?materialID=" & GridView1.DataKeys(index).Value.ToString())

    End Sub

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand

        If e.CommandName = "View" Then

            Dim index As Integer = Convert.ToInt32(e.CommandArgument)

            Response.Redirect("details.aspx?materialID=" & GridView1.DataKeys(index).Value.ToString())
        End If

    End Sub

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound



    End Sub
End Class